package tako.wisers.com.android;

import java.io.IOException;

import javax.jdo.PersistenceManagerFactory;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import tako.wisers.com.android.jdo.PMF;
import tako.wisers.com.android.upload.Uploader;


import com.google.apphosting.utils.remoteapi.RemoteApiServlet;

public class RemoteInteface extends RemoteApiServlet {
	private static final long serialVersionUID = -5482834818474556485L;
	private final PersistenceManagerFactory pmf = PMF.get();
	
	@Override
	protected void doPut(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		Uploader upload = new Uploader(pmf);
		upload.uploaderExecute(req, resp);
	}
	
	@Override
	public void doPost(HttpServletRequest arg0, HttpServletResponse arg1)
			throws IOException {
		// TODO Auto-generated method stub
		try {
			doPut(arg0, arg1);
		} catch (ServletException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
